<template>
    <div class="headers">
        <navigation-bar :title="'培优策'" :onLeftButtonClick="()=>{}" :onRightButtonClick="minibarRightButtonClick"
                        :rightIcon="'\ue627'" :leftIcon="''"></navigation-bar>
        <slider class="slider" interval="3000" auto-play="true">
            <div class="frame" v-for="img in imageList">
                <image class="image" resize="cover" :src="img.src"></image>
            </div>
        </slider>
        <wxc-tab-page ref="wxc-tab-page"
                      :tab-titles="tabTitles"
                      :tab-styles="tabStyles"
                      title-type="icon"
                      :tab-page-height="100"
                      @wxcTabPageCurrentTabSelected="wxcTabPageCurrentTabSelected">
        </wxc-tab-page>
    </div>
</template>
<style scoped>
    .image {
        width: 750px;
        height: 300px;
    }
    .slider {
        width: 750px;
        height: 300px;
    }
    .frame {
        width: 750px;
        height: 300px;
        position: relative;
    }
</style>
<script>
  import {WxcTabPage, WxcPanItem} from 'weex-ui';
  import Config from '../../config/HomeTabConfig'
  import NavigationBar from './NavigationBar.vue'
  export default {
    components: { WxcTabPage, WxcPanItem,NavigationBar },
    data() {
      return {
        tabTitles: Config.tabTitles,
        tabStyles: Config.tabStyles,
        // imageList: [
        //   { src: 'https://gd2.alicdn.com/bao/uploaded/i2/T14H1LFwBcXXXXXXXX_!!0-item_pic.jpg'},
        //   { src: 'https://gd1.alicdn.com/bao/uploaded/i1/TB1PXJCJFXXXXciXFXXXXXXXXXX_!!0-item_pic.jpg'},
        //   { src: 'https://gd3.alicdn.com/bao/uploaded/i3/TB1x6hYLXXXXXazXVXXXXXXXXXX_!!0-item_pic.jpg'}
        // ]
      }
    },
    computed: {
      imageList() {
        return this.$store.state.event.home_slider_list;
      },
    },
    methods: {
      minibarRightButtonClick() {
        this.jumpWithParams("SearchPage",{})
      },
      wxcTabPageCurrentTabSelected(e){
        const self = this;
        console.log(e)
        const index = e.page;
      }
    }
  }
</script>
